<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
    <title>EasyCMS内容管理系统</title>
    <link href="__PUBLIC__/Css/bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/Css/login.css" rel="stylesheet">
    <script src="__PUBLIC__/Js/jquery-1.7.2.js"></script>
    <script>
    $(function(){
        $('input[name="username"]').focus(function(){
          $('#umessage').remove();
        });
          
        $('input[name="username"]').blur(function(){
          var username=$(this).val();
            $.get('__APP__/Login/checkName',{'username':username},function(data){
            if(username!=''){
              if(data=='不允许'){
                $('input[name="username"]').after('<span id="umessage" style="color:red">该用户名已经注册</span>');
              }else{
                $('input[name="username"]').after('<span id="umessage" style="color:green">恭喜可以注册</span>');
              }
              }else{
                $('input[name="username"]').after('<span id="umessage" style="color:blue">注册名不能为空</span>');
            }
            })
          });
      });

function fleshVerify(type){ 
	//重载验证码
	var timenow = new Date().getTime();
	if (type){
		$('#verifyImg').attr("src", '__URL__/verify/adv/1/'+timenow);
	}else{
		$('#verifyImg').attr("src", '__URL__/verify/'+timenow);
	}
}
   </script>

  </head>
<body>
  <div class="container">
    <form class="form-signin" role="form" action="<{:U('Login/checkregs')}>" method="post">
        <h4 class="form-signin-heading" style="font-family:'微软雅黑';font-size:20px;">账号注册</h4>
          <input type="text" class="form-control"  name="username" placeholder="账号(必填)" required><span></span>
        
          <input type="password" class="form-control" name="password" placeholder="密码(必填)" required>
          <input type="password" class="form-control" name="repassword" placeholder="确认密码(必填)" required>
          <input type="text" class="form-control" name="email" placeholder="邮箱(必填)" required>
          <input type="text" class="form-control" name="code" placeholder="验证码(必填)" required width="40"
          style="width:200px;display:inline;valign:center;">
          <span>
          <img id="verifyImg" SRC="<{:U('Login/verify')}>" onClick="fleshVerify(this)" border="0" alt="点击刷新验证码" style="cursor:pointer;width:80px;vertical-align:top;" align="absmiddle">
          </span>
          <div id="regsex" style="height:40px;">性别：男&nbsp;<input style="margin-right: 20px;" type="radio" name='sex' value="1" checked="checked" >女<input  type="radio" name='sex' value="0"  >
 <a href="<{:U('Index/Login/index')}>" class="btn btn-link" style="float:right" title="注册">已有账号</a><a href="<{:U('Index/Index/index')}>" class="btn btn-link" style="float:right" title="返回">>>返回首页</a>
          </div>

          <button class="btn btn-lg btn-primary btn-block" type="submit">手机注册</button>
      </form>
    </div>
  </body>
  </html>
